package com.wave.wavesystem.ai.agent;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 步骤的具体实现
 */
@EqualsAndHashCode(callSuper = true)
@Data
public abstract class ReActAgent extends BaseAgent {

    /**
     * 处理当前状态 并决定下一步
     */
    public abstract boolean think();

    /**
     * 执行决定的结果
     */
    public abstract String act();


    @Override
    public String step() {
        try {
            boolean shouldAct = think();
            if (!shouldAct) {
                return "思考完成 - 无须再行动";
            }
            return act();
        } catch (Exception e) {
            e.printStackTrace();
            return "步骤执行失败：" + e.getMessage();
        }
    }
}
